package org.baixin.action.permission;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.baixin.action.BaseAction;
import org.baixin.core.PropertyFilter;
import org.baixin.entity.Role;
import org.baixin.exception.AppException;
import org.baixin.manager.RoleManager;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 
 * 
 * 角色控制器
 * 
 * @author slaton.wu@gmail.com
 * @version 1.0
 * @created 2011-6-25 上午08:35:24
 */
@ParentPackage("pm-default")
@Namespace("/role")
@Results({
		@Result(name = "list", location = "/WEB-INF/pages/role/list.jsp" )
})
public class RoleAction extends BaseAction<Role, RoleManager> {

	/**
	 * @return
	 * @throws AppException
	 * @see org.baixin.action.BaseAction#list()
	 */
	@Action("/role/list")
	@Override
	public String list() throws AppException {
		
		List<PropertyFilter> filters = PropertyFilter.buildFromHttpRequest(request);
		page = entityManager.search(page,filters);
		return LIST;
	}

	/**
	 * @return
	 * @throws AppException
	 * @see org.baixin.action.BaseAction#input()
	 */
	@Override
	public String input() throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @return
	 * @throws AppException
	 * @see org.baixin.action.BaseAction#save()
	 */
	@Override
	public String save() throws AppException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @return
	 * @throws AppException
	 * @see org.baixin.action.BaseAction#delete()
	 */
	@Action("/delete")
	@Override
	public String delete() throws AppException {
		
		return null;
	}

	/**
	 * @param entityManager
	 * @see org.baixin.action.BaseAction#setEntityManager(org.baixin.manager.BaseManager)
	 */
	@Autowired
	@Override
	public void setEntityManager(RoleManager roleManager) {
		
		this.entityManager = roleManager;
	}

}
